	<?php $this->load->view('admin/partials/tournament_menu'); ?>
	<?php 
		$ci= &get_instance();
		$tournamentArray = $ci->tournament_entity->getTournamentByStatus("cancelled");
	
	?>
	
	<div class="clrboth"></div>
	
	<h3>Tournament &raquo; <?php echo ucfirst($this->uri->segment(4,''));?></h3>
	<?php 
	//$buttons = array('buttons'=>array('Add#add_new_tournament();') );
	?>
	<?php //$this->load->view('admin/partials/buttons', $buttons );
	?>
	
	<div class="clrboth"></div>
	
	<table border="0" class="table-list">
		<thead>
			<tr>
			<!--	<th>Sport</th>	-->
				<th>Tournament</th>
				<th>Start</th>
				<th>End</th>
				<th>Prize</th>
				<th>Rank</th>
				<th><?php echo lang('dataman.manage'); ?></th>
			</tr>
		</thead>
		
		<tbody>
			<?php foreach( $tournamentArray as $item ): ?>
				<?php 
					$TOURNAMENT = $ci->tournament_entity->init('id',$item->id);
					$SPORT = $ci->sport_entity->init('id', $TOURNAMENT->getSportId());
				?>
				<tr>
				 
					<td><a href="<?php echo site_url('admin/dataman/match/in_tournament/?t_id='.$TOURNAMENT->getId());?>" ><?php echo $TOURNAMENT->getName(); ?></a></td>
					<td><?php echo sysDateTimeFormat($TOURNAMENT->getStartTime()); ?></td>
					<td><?php echo sysDateTimeFormat($TOURNAMENT->getEndTime()); ?></td>
					<td>
						<a href="javascript:void(0);" onclick="prize_add(<?php echo $TOURNAMENT->getId();?>)">Add</a>&nbsp;|&nbsp;
						<a href="javascript:void(0);" onclick="prize_view(<?php echo $TOURNAMENT->getId();?>)">View</a>
					</td>
					<td><a href="javascript:void(0);" onclick="rank_view(<?php echo $TOURNAMENT->getId();?>)">View</a></td>
					<td>
					<!--	<a href="javascript:void(0);" onclick="tournament_edit(<?php echo $TOURNAMENT->getId();?>,'upcoming')"><?php echo lang('dataman.edit');?></a>
						&nbsp;|&nbsp;
						<a href="javascript:void(0);" onclick="tournament_cancel(<?php echo $TOURNAMENT->getId();?>)" >Cancel</a>
						&nbsp;|&nbsp;		-->
						<a href="javascript:void(0);" onclick="tournament_publish_unpublish(<?php echo $TOURNAMENT->getId();?>)" ><?php echo ucfirst($TOURNAMENT->getPublish());?></a>
					</td>
				</tr>
				 
			<?php endforeach; ?>
		</tbody>
	</table>
	
<?php //$this->load->view( 'admin/tournament/add_edit_tournament' ); 
?>